/******************************************************************************************
 * Import
 ******************************************************************************************/

// module
import Taro, { Component } from '@tarojs/taro'

// project
import { CPage, CContent, CHeader, CFooter, CFloat, CAround, CBetween, CCenter, CRow, CWrap, CLine, CHand, CItemX, CItemY, CText, CLabel, CSvg, CImage, CButton, CColumn } from '../../../../library/comp';
import { Base64, Gen, Time, Zip, Session, Storage, Http } from '../../../../library/func';
import Icon from '../../../../project/style/icon';
import DoHttp from '../../../../project/func/http/http';

/******************************************************************************************
 * Export Class
 ******************************************************************************************/

export default class Index extends Component {

	/*------------------------------------------------------------------------------------
	 * 初始化
	 *-----------------------------------------------------------------------------------*/
	constructor(props) {
		super(props);

		/**
		 * state
		 */
		this.state = {
			detail: {
				object: {
					set_head: '',
					set_nick: ''
				},
				enum_dist_type: '',
				vip_mobile: ''
			}
		}
	}

	/*------------------------------------------------------------------------------------
	 * 生命周期
	 *-----------------------------------------------------------------------------------*/
	// didMount
	componentDidMount() {
		// 获取粉丝用户详情
		DoHttp.get({
			url: 'vip/fansDetail.php',
			data: {
				id: this.$router.params.id
			},
			success: (data)=> {
				console.log(data);
				this.setState({
					detail: data
				})
			},
			error: (res)=> {
				console.log('逻辑错误');
				console.log(res);
			}
		});
	}
	
	/*------------------------------------------------------------------------------------
	 * 事件处理
	 *-----------------------------------------------------------------------------------*/
	
	/*------------------------------------------------------------------------------------
	 * 自定义方法
	 *-----------------------------------------------------------------------------------*/
	config = {
        navigationBarTitleText: '个人资料',
        navigationBarBackgroundColor: '#000',
        navigationBarTextStyle: '#fff'
    }
	/*------------------------------------------------------------------------------------
	 * 渲染
	 *-----------------------------------------------------------------------------------*/
	render () {
		console.log('aaa is' , this.state.detail.vip_mobile)
		return (
			<CPage>
				<CContent>
					
					{/* 头像显示 */}
					<CCenter bg='#000' h='400' rb='40'>
						<CItemY>
							<CImage w='120' h='120' ra='70' src='{{detail.object.set_head}}'></CImage>
							<CHand mt='30' size='36' color='#ebe8d8'>{detail.object.set_nick}</CHand>
						</CItemY>
					</CCenter>

					{/* 数据记录 */}
					<CColumn ma='20' ra='20' bg='#fff' mt='-70'>
						<CLine pa='28' h='40' bb='2 solid #eee'>
							<CText size='30'>数据记录</CText>
						</CLine>
						<CBetween h='40' rt='18' pa='20'>
							<CText color='#b0b0b0' size='28'>来源</CText>
							<CHand size='28' color='#464646'>{detail.enum_dist_type}</CHand>
						</CBetween>
					</CColumn>

					{/* 联系方式 */}
					<CColumn ma='20' ra='20' bg='#fff'>
						<CLine pa='28' h='40' bb='2 solid #eee'>
							<CText size='30'>联系方式</CText>
						</CLine>
						<CBetween h='40' rt='18' pa='20'>
							<CText color='#b0b0b0' size='28'>手机号</CText>
							<CHand size='28' color='#464646'>{detail.vip_mobile}</CHand>
						</CBetween>
					</CColumn>

				</CContent>
			</CPage>
		)
	}
}


